package com.test.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;

import com.sun.istack.internal.NotNull;

@Entity
public class Father {

	private int id;
	private String name;
	private int age;
	
	private Set<Son> son = new HashSet<Son>();
	
	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	@Column(length=5)
	@NotNull
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	@OneToMany
	@JoinColumn(name="fatherID")
	public Set<Son> getSon() {
		return son;
	}
	public void setSon(Set<Son> son) {
		this.son = son;
	}
	
	
}
